from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP

from unipath import Path
PROJECT_DIR = Path(__file__).parent

LOGIN_REDIRECT_URL='/'
LOGOUT_REDIRECT_URL='/'

DEBUG = True
TEMPLATE_DEBUG = DEBUG

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
)

#FACEBOOK_EXTENDED_PERMISSIONS = ['email']

#FFACEBOOK_PROFILE_EXTRA_PARAMS = {'locale': 'ru_RU'}

SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'

ADMINS = (
    ('Dickfarney Gomes', 'dickfarney@gmail.com'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'C:\\Projetos\\CodeExam\\ConselhoVeneraveis.db',
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
    }
}

TIME_ZONE = 'America/Sao_Paulo'

LANGUAGE_CODE = 'pt-br'

SITE_ID = 1

USE_I18N = True

USE_L10N = True

USE_TZ = True

MEDIA_ROOT = PROJECT_DIR.child('media')

MEDIA_URL = ''

STATIC_ROOT = PROJECT_DIR.child('public')

STATIC_URL = '/static/'

STATICFILES_DIRS = (
                    
    PROJECT_DIR.parent.child('static'),
)

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)

SECRET_KEY = 'afnugcijj%%wuim=ixz7qs0n+4m@(osz9w9ou=_t9#!c1#6!-)'

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'CodeExam.urls'

WSGI_APPLICATION = 'CodeExam.wsgi.application'

TEMPLATE_DIRS = (
                 
    PROJECT_DIR.parent.child('templates'),
)

TEMPLATE_CONTEXT_PROCESSORS = TCP + (
    'django.core.context_processors.request',
)


INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    'home',
    'Agenda',
)

LOGIN_URL = '/login/'

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        }
    },
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'filters': ['require_debug_false'],
            'class': 'django.utils.log.AdminEmailHandler'
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
    }
}
